﻿<!DOCTYPE html>
@using CNRegex.Web.Base
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function () {
			var alinks = document.getElementById("ulMenu").getElementsByTagName("a");
			var isHasCurrent = false;
			for (var i = 0; i < alinks.length; i++) {
				if (window.location.href.indexOf(alinks[i].href) != -1) {
					alinks[i].setAttribute("class", "current");
					isHasCurrent = true;
					return;
				}
			}
			if (!isHasCurrent)
				alinks[0].setAttribute("class", "current");
		});
	</script>
</head>

<body>
	<div class="header_main">
		 
	<div class="header"> 
		<a class="logo" href="/"></a> 
		<ul class="main_menu"> 
			<li>
				@{
					var displayLogin = FrontContext.CurrentRegexUser == null ? "block" : "none";
					var displayLoginOut = FrontContext.CurrentRegexUser == null ? "none" : "block";
					var user = FrontContext.CurrentRegexUser == null ? "nothing" : FrontContext.CurrentRegexUser.Name;
				}
				<span class="login" style="display:@displayLogin">
					<a href="/account/login">登录</a> |  <a href="/account/register">注册</a>
				</span>
				<span class="login" style="display:@displayLoginOut">
					<a href="/@user">@(FrontContext.CurrentRegexUser==null?"":FrontContext.CurrentRegexUser.Name)</a> |  <a href="/account/loginout">注销</a>
				</span>
			</li>
		</ul> 
		<div class="clear"></div> 
	</div> 
	<div class="menu"> 
		<ul class="nav" id="ulMenu"> 
			<li><a href="/Home">首页</a></li>
			<li><a href="/Blog">文章</a></li> 
			<li><a href="/RegexHome">表达式</a></li> 
			<li><a href="/RegexTutorial">正则教程</a></li>
			<li><a href="/DesignPattern">设计模式</a></li>
			<li><a href="/suanfa">算法</a></li> 
			<li><a href="/books">UI设计</a></li>
			<li><a href="/books">图书</a></li> 
			<li><a href="/news">新闻</a></li> 

			<li style="float:right;margin-right:27px;display:@displayLoginOut"><a href='/@user'>我的主页</a></li>
			<li style="float:right;display:@displayLoginOut">
				<a href="/regex/create">添加表达式</a>
			</li>
			<li style="float:right;display:@displayLoginOut"><img src="/images/addRegex.png" alt="+" style=" position:relative; top:7px; right:2px" /></li>
			<li style="float:right;display:@displayLoginOut">
				<a href="/blog/create">写写新随笔</a>
			</li>
			<li style="float:right;display:@displayLoginOut"><img src="/images/addRegex.png" alt="+" style=" position:relative; top:7px; right:2px" /></li>
		</ul> 
	</div> 

	</div>

    <div class="page">
        <div id="main">
            @RenderBody()
            <div id="footer">
            </div>
        </div>
    </div>
</body>
</html>
